import React, { Component } from "react";
import MainLayout from "../../../component/mainLayout/mainLayout";
import "./index.scss";
import rescissionfailo from "../../../images/imageXHB/icon/rescissionfail.png";
import yhTools from "../../../tools/yh";

/* @connect(state => ({
    lnid: state.getAppPlatformsDatas.lnid,
    getAppPlatformsDatas: state.getAppPlatformsDatas
})) */
class rescissionfail extends Component {
	constructor(props) {
		super(props);
		this.state = {};
		this.msg = props.location.state.msg;
	}
	componentDidMount() {}

	/** 打电话 */
	callPhone(telphone) {
		let callPhoneData = {
			telphone
		};
		yhTools.callPhone(callPhoneData);
	}

	/** 开通失败之后的回退 */
	goBack() {
		/**
		 * 证明页面是支付签约失败返回的
		 */
		sessionStorage.setItem("signres_page", "1");
		this.props.history.goBack();
	}

	render() {
		const _pageParams = {
			header: {
				title: "支付关闭结果",
				goBackAction: () => this.props.history.push("/walletHome")
			},
			history: this.props.history,
			cacheLifecycles: this.props.cacheLifecycles
		};
		return (
			<div>
				<MainLayout pageParams={_pageParams}>
					<div className="rescissionfail">
						<div className="imgfail">
							<img src={rescissionfailo} alt="" />
						</div>
						<div className="title">
							<p>小辉宝支付关闭失败</p>
						</div>
						<div className="reason">
							<p>
								失败原因：{this.msg}，您可以拨打银行客服电话{" "}
								<a
									href="javascript:;"
									onClick={() => this.callPhone("4008219666")}
								>
									400-8219-666
								</a>
								获得帮助
							</p>
						</div>
					</div>
					<div className="btnlist">
						<div
							className="gobacktoindex"
							onClick={() => this.props.history.push("/walletHome")}
						>
							回到首页
						</div>
						<div className="restart" onClick={() => this.goBack()}>
							重新解约
						</div>
					</div>
				</MainLayout>
			</div>
		);
	}
}

export default rescissionfail;
